package com.itheima.conllection;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

public class CollectionTest02 {
    public static void main(String[] args) {
        //ListTest();
        LinkedList<Integer> list=new LinkedList<>();
        list.addFirst(111);
        list.add(222);
        list.add(444);
        list.add(333);
        list.addLast(999);
        System.out.println(list.removeLast());
        System.out.println(list.getFirst());
        System.out.println(list);
        System.out.println(list.contains(222));

    }

    private static void ListTest() {
        List<Integer> list=new ArrayList<>();
        list.add(2);
        list.add(5);
        list.add(4);
        System.out.println(list.remove(0));
        System.out.println(list.set(1, 9));
        System.out.println(list.get(1));
        System.out.println(list);
    }
}
